<?php
include_once("./common.inc.php");
$smarty = new Tpl();

//product
$proModel = new Model('product');
$product = $proModel->order('`order`,`id` DESC')->get();
$smarty->assign("product", $product);

//banner
$advModel = new Model('advertise');
$banners = $advModel->where('`type`=1')->order('`order`')->get();
$smarty->assign("banners", $banners);

//product list
$advModel->free_result();
$proList = $advModel->where('`type`=2')->order('`order`')->get();
$smarty->assign('proList', $proList);

//featured list
$advModel->free_result();
$feats = $advModel->where('`type`=3')->order('`order`')->get();
$smarty->assign('featured', $feats);

//comment
$comModel = new Model("comment");
$comms = $comModel->order('id DESC')->get();
$smarty->assign("comms", $comms);

$smarty->display('index.html');
